#include <iostream>
#include <fstream>
#include <cmath>
#include <vector>
#include <map>
using namespace std;

int main() {
    ifstream ifile("input.txt");
    int n;
    ifile >> n;
    vector<int> a(n);
    for(int i = 0; i < n; ++i) {
        //cout << "*" << endl;
        ifile >> a[i];
    }
    ifile.close();

    int totalSum = 0;
    for (vector<int>::const_iterator iter = a.begin(), end = a.end(); iter != end; ++iter)
        totalSum += *iter;

    map<int, int> weight2cnt;
    int lSum = 0;
    int rSum = totalSum;
    for (int i = 0; i < (n-1); ++i) {
        lSum += a[i];
        rSum -= a[i];

        const int w = abs(lSum - rSum);
        ++weight2cnt[w];
    }
    
    const int res = weight2cnt.begin()->second;

    ofstream ofile("output.txt");
    ofile << res;
    ofile.close();
    return 0;
}
